package aiku.numericalcontroloa.Mapper.DepartmentManagement;

import aiku.numericalcontroloa.Model.Dto.PageSelect;
import aiku.numericalcontroloa.Model.Entity.DepartmentManagement.EmployeeDepartment;
import aiku.numericalcontroloa.Model.Entity.DepartmentManagement.EmployeeDepartmentWithUser;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author 黄广庭
 * @Date 2024/2/20 13:33
 */
@Repository
public interface EmployeeDepartmentMapper extends BaseMapper<EmployeeDepartment> {

    /**
     * 联user表查询部门人员列表
     * @param pageSelect
     * @param queryWrapper
     * @return
     */
    List<EmployeeDepartmentWithUser> selectListWithUser(@Param(value = "page")PageSelect pageSelect,
                                                @Param(Constants.WRAPPER) LambdaQueryWrapper<EmployeeDepartmentWithUser> queryWrapper);

    /**
     * 联user表查询部门人员总条数（不去重）
     * @param employeeDepartmentLQW
     * @return
     */
    Integer selectListWithUserTotalAll(@Param(Constants.WRAPPER) LambdaQueryWrapper<EmployeeDepartmentWithUser> employeeDepartmentLQW);

    /**
     * 联user表查询部门人员总条数（去重）
     * @param employeeDepartmentLQW
     * @return
     */
    Integer selectListWithUserTotal(@Param(Constants.WRAPPER) LambdaQueryWrapper<EmployeeDepartmentWithUser> employeeDepartmentLQW);

    /**
     * 批量插入
     * @param list
     * @return
     */
    Integer insertBatch(@Param(value = "list") List<EmployeeDepartment> list);
}
